#include <iostream>
#include <vector>
using namespace std;
 
int is_existent[10][10] = {0};  //0表示未走1表示已走过
vector<vector<int>> path;
//dfs任务：确认从i，j分数为point，是否能逃离迷宫
// int indexx[4] = {-1,1,0,0};
// int indexy[4] = {0,0,1,-1};
bool dfs(vector<vector<int>>& board,int i,int j,int point){
    int n = board.size(),m=board[0].size();
    if(point < 0)   return false;
    if(point >= 0 && i == 0 && j ==m-1){
        path.push_back({0,m-1});
        return true;
    }
    //向左走
    if( j-1 >=0  && board[i][j-1] ==1 && is_existent[i][j-1] ==0){
        path.push_back({i,j});
        is_existent[i][j] = 1;
        if(dfs(board,i,j-1,point-1))    return true;
        is_existent[i][j] = 0;
        path.pop_back();
    }
    //向右走
    if( j+1 < m && board[i][j+1] ==1 && is_existent[i][j+1] ==0){
        is_existent[i][j] = 1;
        path.push_back({i,j});
        if(dfs(board,i,j+1,point-1))    return  true;
        is_existent[i][j] = 0; 
        path.pop_back();
    }
    //向上
    if( i-1 >=0 && board[i-1][j] == 1&& is_existent[i-1][j] ==0){
        is_existent[i][j] = 1;
        path.push_back({i,j});
        if(dfs(board,i-1,j,point-3))    return true;
        is_existent[i][j] = 0;
        path.pop_back();
    }
    //向下
    if( i+1 < n&& board[i+1][j] == 1&& is_existent[i+1][j] ==0){
        is_existent[i][j] = 1;
        path.push_back({i,j});
        if(dfs(board,i+1,j,point))  return true;
        is_existent[i][j] = 0;
        path.pop_back();
    }
    return false;
}

int main() {
    int n,m,p;
    cin>>n>>m>>p;
    vector<vector<int>> board(n,vector<int>(m));
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < m ;j++){
            cin>>board[i][j];
        }
    }
    // path.push_back({0,0});
    // is_existent[0][0] = 1;
    if(dfs(board,0,0,p)){
        int n = path.size();
        for(int i = 0 ; i < n ; i++){
            cout<<"["<<path[i][0]<<","<<path[i][1]<<"]";
            if( i != n-1) cout<<",";
        }
    }else{
        cout<<"Can not escape!"<<endl;
    }
    // for(int i = 0 ; i < n ; i++){
    //     for(int j = 0 ; j < m ;j++){
    //         cout<<board[i][j];
    //     }
    //     cout<<endl;
    // }
    // for(auto & x: path){
    //     cout<<"["<<x[0]<<","<<x[1]<<"]";
    // }
}